
/*
 * 判断值为某个类型
*/ 
export const is = (val: unknown, type: string) => {
  return Object.prototype.toString.call(val) === `[object ${type}]`
}

/*
 * 是否是函数
*/
export const isFunction = <T = Function>(val: unknown): val is T => {
  return is(val, 'Function')
}

